<template>
	<van-nav-bar
	  :title="route.meta.title"
	  left-arrow
	  @click-left="routerBack"
	/>
	<van-cell-group>

	<van-cell title="个人资料" is-link to="/userInfo" />
	<van-cell title="修改密码" is-link to="/editPassword" />
	<van-cell title="关于我们" is-link to="/about" />
	<van-cell title="联系我们" is-link to="/concat" />
	
	</van-cell-group>
	
	<div style="width:96%;margin: 100px auto 0;">
		
		<van-button type="danger" size="large" @click="quit">退出登陆</van-button>
	</div>
	

</template>

<script setup>
	
	import { useRoute } from "vue-router"
	import { showConfirmDialog } from 'vant';
	import useUserStore from "@/store/userStore";
    import { toRefs } from "vue";
import router from "@/router";
	

	
	  let  UserStore  =         useUserStore()
	// console.log(  toRefs(useUserStore()) )
	
	const route = useRoute();
	
	
	function quit(){
		
		showConfirmDialog({
		  title: '提示',
		  message:
		    '您将要退出当前账号,确认吗?',
		})
		  .then((res) => {
		    // on confirm
		UserStore.logout();
		 	localStorage.clear();// 全部清除
		 router.replace('/login')
			
			
		  })
		  .catch(() => {
		    // on cancel
		  });
		
	}
	

</script>

<style>
	
</style>